unit uDMConexao;

interface

uses
  SysUtils, Classes, UniProvider, SQLiteUniProvider, DB, DBAccess, Uni,
  DAScript, UniScript, MemDS;

type
  TdmConexao = class(TDataModule)
    dbConexao: TUniConnection;
    SQLiteUniProvider1: TSQLiteUniProvider;
    sqlEstruturaInicial: TUniScript;
    qrParametros: TUniQuery;
    qrParametrosCHAVE: TMemoField;
    qrParametrosVALOR: TMemoField;
    procedure dbConexaoAfterConnect(Sender: TObject);
    procedure DataModuleCreate(Sender: TObject);
    procedure DataModuleDestroy(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  dmConexao: TdmConexao;

implementation

uses uDB;

{$R *.dfm}

procedure TdmConexao.DataModuleCreate(Sender: TObject);
begin
   clDB := TDB.Create(dbConexao);
end;

procedure TdmConexao.DataModuleDestroy(Sender: TObject);
begin
   FreeAndNil(clDB);
end;

procedure TdmConexao.dbConexaoAfterConnect(Sender: TObject);
begin
   sqlEstruturaInicial.Execute;
end;

end.
